/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.mybatis.annotation.JoinTable;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * 实时库存Entity
 * @author HOHD
 * @version 2020-12-16
 */
@Table(name="st_warehouse_inventory", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="bill_no", attrName="billNo", label="单据号"),
		@Column(name="in_or_out", attrName="inOrOut", label="出或入"),
		@Column(name="bill_category", attrName="billCategory", label="单据种类"),
		@Column(name="warehouse", attrName="warehouse", label="仓位"),
		@Column(name="batch_number", attrName="batchNumber", label="批号"),
		@Column(name="material_code", attrName="materialCode", label="物料名称", queryType=QueryType.LIKE),
		@Column(name="number", attrName="number", label="数量"),
		@Column(name="primary_detail_id", attrName="primaryDetailId", label=""),
		@Column(name="product_date", attrName="productDate", label=""),
		@Column(name="saved_type", attrName="savedType", label=""),
		@Column(name="pass_date", attrName="passDate", label=""),
	}, orderBy="a.id DESC",joinTable = {
		@JoinTable(on="a.warehouse=w.id",type = JoinTable.Type.LEFT_JOIN,attrName = "showWarehouse",entity = StWarehousePositionSetting.class,alias = "w"),
		@JoinTable(on="a.material_code=m.material_code",type = JoinTable.Type.LEFT_JOIN,attrName = "materialRecord",entity = StMaterialRecord.class,alias = "m"),
}
)
public class StWarehouseInventory extends DataEntity<StWarehouseInventory> {
	
	private static final long serialVersionUID = 1L;
	private String billNo;		// 单据号
	private Integer inOrOut;		// 出或入
	private Integer billCategory;		// 单据种类

	private StWarehousePositionSetting showWarehouse;
	private String warehouse;		// 仓位英文
	private String warehouseId;		// 仓位
	private String warehouseName;		// 仓位

	private String detail;

	private String batchNumber;		// 批号
	private Map<String,Integer> warehouseNumber;

	private StMaterialRecord materialRecord;
	private String materialName;		// 物料名称
	private String materialCode;

	private BigDecimal number;		// 数量
	private String primaryDetailId;

	private Date productDate;
	private Integer savedType;
	private Date passDate;

	private Integer canZero;

	public Integer getCanZero() {
		return canZero;
	}

	public void setCanZero(Integer canZero) {
		this.canZero = canZero;
	}

	public String getMaterialCode() {
		return materialCode;
	}

	public void setMaterialCode(String materialCode) {
		this.materialCode = materialCode;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getProductDate() {
		return productDate;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPassDate() {
		return passDate;
	}

	public void setPassDate(Date passDate) {
		this.passDate = passDate;
	}

	public void setProductDate(Date productDate) {
		this.productDate = productDate;
	}

	public Integer getSavedType() {
		return savedType;
	}

	public void setSavedType(Integer savedType) {
		this.savedType = savedType;
	}

	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}

	public String getDetail() {
		return detail;
	}

	public String getWarehouseId() {
		return warehouseId;
	}

	public void setWarehouseId(String warehouseId) {
		this.warehouseId = warehouseId;
	}

	public String getWarehouseName() {
		return warehouseName;
	}

	public void setWarehouseName(String warehouseName) {
		this.warehouseName = warehouseName;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public Map<String, Integer> getWarehouseNumber() {
		return warehouseNumber;
	}

	public void setWarehouseNumber(Map<String, Integer> warehouseNumber) {
		this.warehouseNumber = warehouseNumber;
	}



	public StMaterialRecord getMaterialRecord() {
		return materialRecord;
	}

	public void setMaterialRecord(StMaterialRecord materialRecord) {
		this.materialRecord = materialRecord;
	}

	public StWarehousePositionSetting getShowWarehouse() {
		return showWarehouse;
	}

	public void setShowWarehouse(StWarehousePositionSetting showWarehouse) {
		this.showWarehouse = showWarehouse;
	}

	public String getPrimaryDetailId() {
		return primaryDetailId;
	}

	public void setPrimaryDetailId(String primaryDetailId) {
		this.primaryDetailId = primaryDetailId;
	}

	public StWarehouseInventory() {
		this(null);
	}

	public StWarehouseInventory(String id){
		super(id);
	}
	
	@Length(min=0, max=20, message="单据号长度不能超过 20 个字符")
	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}
	
	public Integer getInOrOut() {
		return inOrOut;
	}

	public void setInOrOut(Integer inOrOut) {
		this.inOrOut = inOrOut;
	}
	
	public Integer getBillCategory() {
		return billCategory;
	}

	public void setBillCategory(Integer billCategory) {
		this.billCategory = billCategory;
	}
	
	@Length(min=0, max=36, message="仓位长度不能超过 36 个字符")
	public String getWarehouse() {
		return warehouse;
	}

	public void setWarehouse(String warehouse) {
		this.warehouse = warehouse;
	}
	
	@Length(min=0, max=20, message="批号长度不能超过 20 个字符")
	public String getBatchNumber() {
		return batchNumber;
	}

	public void setBatchNumber(String batchNumber) {
		this.batchNumber = batchNumber;
	}
	

	public BigDecimal getNumber() {
		return number;
	}

	public void setNumber(BigDecimal number) {
		this.number = number;
	}
	
}